home *** CD-ROM | disk | FTP | other *** search
- Q32558 Intrinsic outp with Conditional Operator (? :) May Fail
- C Compiler
- 5.10 | 5.10
- MS-DOS | OS/2
-
- Summary:
- When using the intrinsic version of outp with the conditional
- operator (?:), the compiler generates code that reverses the meaning
- of the code. For example, if i = 1 in the following code, outp
- is incorrectly called with 3 as the second argument instead of the
- expected 2:
-
- #define PORT 0x123
- send(i)
- int i;
- {
- outp(PORT, (i == 1) ? 2 : 3);
- }
-
- Microsoft has confirmed this to be a problem in Version 5.10 of the
- C compiler. We are researching this problem and will post new
- information as it becomes available.
- If you are using the conditional operator in calls to outp, you can
- work around this problem by using the function version of outp. You can
- also work around this problem by declaring a temporary variable,
- assigning to it the value of the conditional operator, and making the
- call with the temporary variable.
-
-
-
- Keywords: buglist5.10
- Updated 88/07/21 03:19
-